package com.qf.elasticsearch.doc;

import java.io.IOException;
import java.util.Map;

/**
 * create by 郑大仙丶
 * 2019/11/21 12:38
 */
public interface DocService {

    //1. 添加文档.(自动生成id)
    void add(String index,String type,String json) throws IOException;

    //2. 添加文档.(指定id)
    void add(String index,String type,String json,String id) throws IOException;

    //3. 修改文档.
    void update(String index, String type, Map<String,Object> doc, String id) throws IOException;

    //4. 删除文档.
    void delete(String index,String type,String id) throws IOException;

    //5. 批量删除.
    void bulkDelete(String index,String type,String[] ids) throws IOException;

    //6. 批量添加
    void bulkAddOrUpdate (String index,String type,String[] ids,String[] jsonArray) throws IOException;

    //7. 刷新索引.
    void refresh(String index) throws IOException;
}
